package com.dance.spring.learn.jdbc.service;

import com.dance.spring.learn.jdbc.dao.BookDao;
import com.dance.spring.learn.jdbc.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {

    @Autowired
    private BookDao bookDao;

    public void add(User user){
        bookDao.add(user);
    }
    public void update(User user){
        bookDao.update(user);
    }
    public void delete(User user){
        bookDao.delete(user);
    }
    public int selectCount(){
        return bookDao.selectCount();
    }

    public User selectUserById(int id) {
        return bookDao.selectUserById(id);
    }

    public List<User> selectUserList() {
        return bookDao.selectUserList();
    }

    public void batchAdd(List<User> userList) {
        bookDao.batchAdd(userList);
    }

    public void batchUpdate(List<User> userList) {
        bookDao.batchUpdate(userList);
    }

    public void batchDelete(List<User> userList) {
        bookDao.batchDelete(userList);
    }

}
